From 1fb89a540950e76f8f0f5ec08eceb5e41197910a Mon Sep 17 00:00:00 2001 From: Gargaj Date: Tue, 24 Nov 2015 19:33:32 +0100 Subject: fix escaped characters in signs (fixes #1736, fixes #2170) --- src/Protocol/Protocol18x.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp index 17b4dc6fd..373269509 100644 --- a/src/Protocol/Protocol18x.cpp +++ b/src/Protocol/Protocol18x.cpp @@ -2530,10 +2530,15 @@ void cProtocol180::HandlePacketUpdateSign(cByteBuffer & a_ByteBuffer) } AString Lines[4]; + Json::Value root; + Json::Reader reader; for (int i = 0; i < 4; i++) { HANDLE_READ(a_ByteBuffer, ReadVarUTF8String, AString, Line); - Lines[i] = Line.substr(1, Line.length() - 2); // Remove "" + if (reader.parse(Line, root, false)) + { + Lines[i] = root.asString(); + } } m_Client->HandleUpdateSign(BlockX, BlockY, BlockZ, Lines[0], Lines[1], Lines[2], Lines[3]); -- cgit v1.2.3